// Package coding_round_1 23-100
// @Title coding_round_1
// @Description
// @Author  == 琳琳也叫王木木 ==  2021/9/14 11:37
// @Create  2021/9/14 11:37
package coding_round_1

// IsSameTree 判断两棵树是不是相同的树
func IsSameTree(p *TreeNode, q *TreeNode) bool {
	if p == nil && q == nil {
		return true
	}
	if p == nil || q == nil {
		return false
	}
	if p.Val != q.Val {
		return false
	}
	return IsSameTree(p.Left, q.Left) && IsSameTree(p.Right, q.Right)
}
